/*
 * @Descripttion: 
 * @Author: zhaozheng
 * @Version: 0.0.1
 * @Date: 2022-09-20 15:08:23
 * @LastEditors: zhaozheng
 * @LastEditTime: 2022-09-21 11:22:21
 */
let baseUrl = process.env.VUE_APP_PROXY_API_HOST;
// console.log(baseUrl, "baseUrlbaseUrlbaseUrlbaseUrl");
export { baseUrl };
export function param(json) {
    if (!json) return ''
    return cleanArray(
        Object.keys(json).map(key => {
        if (json[key] === undefined) return ''
        return encodeURIComponent(key) + '=' + encodeURIComponent(json[key])
        })
    ).join('&')
}
export function cleanArray(actual) {
  const newArray = []
  for (let i = 0; i < actual.length; i++) {
    if (actual[i]) {
      newArray.push(actual[i])
    }
  }
  return newArray
}
//时间戳转时间
export function formatDateTime (inputTime) {
	var date = new Date(Number(inputTime));
	var y = date.getFullYear();
	var m = date.getMonth() + 1;
	m = m < 10 ? "0" + m : m;
	var d = date.getDate();
	d = d < 10 ? "0" + d : d;
	var h = date.getHours();
	h = h < 10 ? "0" + h : h;
	var minute = date.getMinutes();
	var second = date.getSeconds();
	minute = minute < 10 ? "0" + minute : minute;
	second = second < 10 ? "0" + second : second;
	return y + "-" + m + "-" + d + " " + h + ":" + minute + ":" + second;
}